package com.hyhy.hycloud.commons.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author lanpengfei
 * @date 2018/12/7
 */
@AllArgsConstructor
public enum DataScope {
    /**
     *
     */
    ALL(1),
    SELF(2),
    SELF_SUBORDINATE(3),
    SUPERIOR_SELF(4);

    @Getter
    private Integer value;

    public static DataScope valueOf(Integer value) {
        switch (value) {
            case 1:
                return ALL;
            case 2:
                return SELF;
            case 3:
                return SELF_SUBORDINATE;
            case 4:
                return SUPERIOR_SELF;
            default:
                throw new UnsupportedOperationException();
        }
    }
}
